Pular para o conteúdo principal

12 parcelas

Segurança

Para acessar a API, é necessário obter um token de acesso através do fluxo de autenticação OAuth2. Veja mais detalhes em Como obter acesso?

info

Ao gerar o token JWT, não esqueça de utilizar o escopo correto. Caso contrário, a requisição será rejeitada com o código de erro 401 Unauthorized.

Descrição dos campos

CampoTipoDescrição
interest_ratenumberTaxa de juros. No formato "0.0000"
present_valuenumberValor atual
number_of_paymentsnumberNúmero de parcelas
payment_dates[]stringArray de datas. No formato "YYYY-MM-DD"

Requisição

POST https://api-sandbox.catalisa.com.br/calc-engine/api/loan-amortization-schedule-calculator/calculations JWT scope: calculations-engine/calculate

Parâmetros

Sem parâmetros

Cabeçalhos

NomeValor
AuthorizationBearer <token>
Content-Typeapplication/json

Exemplo de Requisição

Corpo da Requisição

{
"data": {
"type": "calculations",
"attributes": {
"interest_rate": 0.0465,
"present_value": 10000,
"number_of_payments": 12,
"payment_dates": [
"2023-07-22",
"2023-08-22",
"2023-09-22",
"2023-10-22",
"2023-11-22",
"2023-12-22",
"2024-01-22",
"2024-02-22",
"2024-03-22",
"2024-04-22",
"2024-05-22",
"2024-06-22"
]
}
}
}

Respostas

CódigoDescrição
201Criado com sucesso. Retorna os dados da tabela de amortização.
401Não autorizado

Exemplo de uso

const headers = new Headers();
headers.append("Authorization", "Bearer <token>");
headers.append("Content-Type", "application/json");

const body = JSON.stringify({
data: {
type: "calculations",
attributes: {
interest_rate: 0.0465,
present_value: 10000,
number_of_payments: 12,
payment_dates: [
"2023-07-22",
"2023-08-22",
"2023-09-22",
"2023-10-22",
"2023-11-22",
"2023-12-22",
"2024-01-22",
"2024-02-22",
"2024-03-22",
"2024-04-22",
"2024-05-22",
"2024-06-22"
]
}
}
});

const requestOptions = {
method: "POST",
headers: headers,
body: body,
};

const response = await fetch(
"https://api-sandbox.catalisa.com.br/calc-engine/api/loan-amortization-schedule-calculator/calculations",
requestOptions
);
const data = await response.json();
console.log(data);

Exemplo de Sucesso

{
"data": {
"id": "7335b857-8bd9-492a-a380-c649178a748d",
"type": "calculations",
"attributes": {
"amortization_schedule": [
{
"payment_number": 1,
"payment_date": "2023-07-22",
"beginning_balance": 10000,
"payment": 1106.09236,
"principal_payment": 641.09236,
"interest_payment": 465,
"remaining_balance": 9358.9076
},
{
"payment_number": 2,
"payment_date": "2023-08-22",
"beginning_balance": 9358.90764,
"payment": 1106.09236,
"principal_payment": 670.90315,
"interest_payment": 435.18921,
"remaining_balance": 8688.0045
},
{
"payment_number": 3,
"payment_date": "2023-09-22",
"beginning_balance": 8688.00449,
"payment": 1106.09236,
"principal_payment": 702.10015,
"interest_payment": 403.99221,
"remaining_balance": 7985.9043
},
{
"payment_number": 4,
"payment_date": "2023-10-22",
"beginning_balance": 7985.90434,
"payment": 1106.09236,
"principal_payment": 734.74781,
"interest_payment": 371.34455,
"remaining_balance": 7251.1565
},
{
"payment_number": 5,
"payment_date": "2023-11-22",
"beginning_balance": 7251.15653,
"payment": 1106.09236,
"principal_payment": 768.91358,
"interest_payment": 337.17878,
"remaining_balance": 6482.243
},
{
"payment_number": 6,
"payment_date": "2023-12-22",
"beginning_balance": 6482.24295,
"payment": 1106.09236,
"principal_payment": 804.66806,
"interest_payment": 301.4243,
"remaining_balance": 5677.5749
},
{
"payment_number": 7,
"payment_date": "2024-01-22",
"beginning_balance": 5677.57489,
"payment": 1106.09236,
"principal_payment": 842.08513,
"interest_payment": 264.00723,
"remaining_balance": 4835.4898
},
{
"payment_number": 8,
"payment_date": "2024-02-22",
"beginning_balance": 4835.48976,
"payment": 1106.09236,
"principal_payment": 881.24209,
"interest_payment": 224.85027,
"remaining_balance": 3954.2477
},
{
"payment_number": 9,
"payment_date": "2024-03-22",
"beginning_balance": 3954.24767,
"payment": 1106.09236,
"principal_payment": 922.21984,
"interest_payment": 183.87252,
"remaining_balance": 3032.0278
},
{
"payment_number": 10,
"payment_date": "2024-04-22",
"beginning_balance": 3032.02783,
"payment": 1106.09236,
"principal_payment": 965.10307,
"interest_payment": 140.98929,
"remaining_balance": 2066.9248
},
{
"payment_number": 11,
"payment_date": "2024-05-22",
"beginning_balance": 2066.92476,
"payment": 1106.09236,
"principal_payment": 1009.98036,
"interest_payment": 96.112,
"remaining_balance": 1056.9444
},
{
"payment_number": 12,
"payment_date": "2024-06-22",
"beginning_balance": 1056.9444,
"payment": 1106.09236,
"principal_payment": 1056.94445,
"interest_payment": 49.14791,
"remaining_balance": 0
}
]
}
}
}